package com.zw.yzk.kabu.model;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by zhanwei on 2017/3/15.
 */

public class QRCodeModel implements Parcelable {
    private String title;
    private int count;
    private float totalPrice;
    private String serialNumber;
    private String checkCode;
    private boolean invalid;
    private String time;

    public String getTime() {
        return time;
    }

    public void setTime(String time) {
        this.time = time;
    }

    public boolean isInvalid() {
        return invalid;
    }

    public void setInvalid(boolean invalid) {
        this.invalid = invalid;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        this.count = count;
    }

    public float getTotalPrice() {
        return totalPrice;
    }

    public void setTotalPrice(float totalPrice) {
        this.totalPrice = totalPrice;
    }

    public String getSerialNumber() {
        return serialNumber;
    }

    public void setSerialNumber(String serialNumber) {
        this.serialNumber = serialNumber;
    }

    public String getCheckCode() {
        return checkCode;
    }

    public void setCheckCode(String checkCode) {
        this.checkCode = checkCode;
    }


    public QRCodeModel() {
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.title);
        dest.writeInt(this.count);
        dest.writeFloat(this.totalPrice);
        dest.writeString(this.serialNumber);
        dest.writeString(this.checkCode);
        dest.writeByte(this.invalid ? (byte) 1 : (byte) 0);
        dest.writeString(this.time);
    }

    protected QRCodeModel(Parcel in) {
        this.title = in.readString();
        this.count = in.readInt();
        this.totalPrice = in.readFloat();
        this.serialNumber = in.readString();
        this.checkCode = in.readString();
        this.invalid = in.readByte() != 0;
        this.time = in.readString();
    }

    public static final Creator<QRCodeModel> CREATOR = new Creator<QRCodeModel>() {
        @Override
        public QRCodeModel createFromParcel(Parcel source) {
            return new QRCodeModel(source);
        }

        @Override
        public QRCodeModel[] newArray(int size) {
            return new QRCodeModel[size];
        }
    };
}
